<html>
<head><meta charset="utf-8"><title>opaque type feedback · wg-traits · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/index.html">wg-traits</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/opaque.20type.20feedback.html">opaque type feedback</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="203118554"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/opaque%20type%20feedback/near/203118554" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/opaque.20type.20feedback.html#203118554">(Jul 07 2020 at 15:32)</a>:</h4>
<p>Hey <span class="user-mention" data-user-id="125131">@detrumi</span> -- so I'd like to try and give some feedback on the opaque type stuff. What is the best format for this?</p>



<a name="203118574"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/opaque%20type%20feedback/near/203118574" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/opaque.20type.20feedback.html#203118574">(Jul 07 2020 at 15:32)</a>:</h4>
<p>I'm looking a bit at the two pending PRs, and maybe that's the right place to start?</p>



<a name="203118591"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/opaque%20type%20feedback/near/203118591" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/opaque.20type.20feedback.html#203118591">(Jul 07 2020 at 15:32)</a>:</h4>
<p>I was also debating about trying to write docs for the chalk book</p>



<a name="203118602"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/opaque%20type%20feedback/near/203118602" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/opaque.20type.20feedback.html#203118602">(Jul 07 2020 at 15:32)</a>:</h4>
<p>that could sort of "guide" the PRs</p>



<a name="203119207"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/opaque%20type%20feedback/near/203119207" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/opaque.20type.20feedback.html#203119207">(Jul 07 2020 at 15:37)</a>:</h4>
<p>I'm trying that</p>



<a name="203128632"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/opaque%20type%20feedback/near/203128632" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/opaque.20type.20feedback.html#203128632">(Jul 07 2020 at 16:46)</a>:</h4>
<p>Yes, I think docs would help</p>



<a name="203128932"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/opaque%20type%20feedback/near/203128932" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/opaque.20type.20feedback.html#203128932">(Jul 07 2020 at 16:48)</a>:</h4>
<p>For the where clauses, I made a start with changing the bounds from <code>VariableKind</code> to <code>TraitBound</code> in the parser, but that changed all kinds of things around the lowering, such as <code>LowerTypeKind</code> not being relevant for opaque types any more</p>



<a name="203129260"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/opaque%20type%20feedback/near/203129260" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/opaque.20type.20feedback.html#203129260">(Jul 07 2020 at 16:51)</a>:</h4>
<p>And for the <a href="https://github.com/rust-lang/chalk/pull/499">WF checks PR</a>, it was a mix of being unfamiliar with the GoalBuilder api, and not being sure what the correct goals should be</p>



<a name="203130569"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/opaque%20type%20feedback/near/203130569" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/opaque.20type.20feedback.html#203130569">(Jul 07 2020 at 17:02)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> Ah, you suggested the <code>opaque type Foo&lt;T: Eq&gt;: Debug = ...;</code> syntax before in <a href="https://github.com/rust-lang/chalk/pull/498#discussion_r436724629">a comment</a>, but the separate <code>where</code> clause makes more sense</p>



<a name="203131033"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/opaque%20type%20feedback/near/203131033" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/opaque.20type.20feedback.html#203131033">(Jul 07 2020 at 17:06)</a>:</h4>
<p><span class="user-mention" data-user-id="125131">@detrumi</span> if this approach is useful, I think i'll push a bit more towards laying out what I see as all the rules we need</p>



<a name="203131054"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/opaque%20type%20feedback/near/203131054" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/opaque.20type.20feedback.html#203131054">(Jul 07 2020 at 17:06)</a>:</h4>
<p>(and then try to take a look at your PRs as needed)</p>



<a name="203131076"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/opaque%20type%20feedback/near/203131076" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/opaque.20type.20feedback.html#203131076">(Jul 07 2020 at 17:06)</a>:</h4>
<p>I think the "doc first" seems good, though, since we wind up with docs at the end too :)</p>



<a name="203133782"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/opaque%20type%20feedback/near/203133782" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/opaque.20type.20feedback.html#203133782">(Jul 07 2020 at 17:29)</a>:</h4>
<p>Hmm, seems like it's  better to implement WF checks first, since without those I can't really test the where clauses</p>



<a name="203143847"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/opaque%20type%20feedback/near/203143847" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/opaque.20type.20feedback.html#203143847">(Jul 07 2020 at 18:52)</a>:</h4>
<p>yeah one thing that I realized is that I don't...actulaly know to what extent chalk implements WF checks...</p>



<a name="203143855"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/opaque%20type%20feedback/near/203143855" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/opaque.20type.20feedback.html#203143855">(Jul 07 2020 at 18:52)</a>:</h4>
<p>I have to go refresh my memory about this</p>



<a name="203408434"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/opaque%20type%20feedback/near/203408434" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Nathan Whitaker <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/opaque.20type.20feedback.html#203408434">(Jul 09 2020 at 16:28)</a>:</h4>
<p>Hey <span class="user-mention" data-user-id="125131">@detrumi</span>, I hope you don't mind but I've been working a bit on the opaque type where clauses and I <em>think</em> I've made some progress. Just filed a <a href="https://github.com/rust-lang/chalk/pull/563">PR</a> with the changes.</p>



<a name="203408752"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/opaque%20type%20feedback/near/203408752" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/opaque.20type.20feedback.html#203408752">(Jul 09 2020 at 16:32)</a>:</h4>
<p>Yeah, I don't mind, go for it!</p>



<a name="203408785"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/opaque%20type%20feedback/near/203408785" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/opaque.20type.20feedback.html#203408785">(Jul 09 2020 at 16:32)</a>:</h4>
<p>I'll take a look</p>



<a name="203409497"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/opaque%20type%20feedback/near/203409497" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/opaque.20type.20feedback.html#203409497">(Jul 09 2020 at 16:37)</a>:</h4>
<p>(seems like the build broke because of a broken mdbook link, but that's unrelated to the PR)</p>



<a name="203409962"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/opaque%20type%20feedback/near/203409962" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/opaque.20type.20feedback.html#203409962">(Jul 09 2020 at 16:41)</a>:</h4>
<p>Huh, that's simpler than expected, well done <span aria-label="slight smile" class="emoji emoji-1f642" role="img" title="slight smile">:slight_smile:</span></p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>